/* 1.首先安装依赖 */
// $ npm install http-proxy-middleware --save
/* 2.然后创建 src/setupProxy.js 并写入一下转发规则 */
const {createProxyMiddleware:proxy} = require('http-proxy-middleware');
module.exports = function (app) {
    app.use(proxy('/api', {
        target: 'http://chst.vip',
        pathRewrite: {
            "^/api": ""
        }
    }));
    app.use(proxy('/auth', {
        target: 'http://127.0.0.1:4002/',
        pathRewrite: {
            "^/auth": "/"
        }
    }));
};
  